import { ApiProperty } from '@nestjs/swagger';

//返回注册接口所对应的类
export class CreaseResponse {
  @ApiProperty({ example: 200 })
  code?: number;
  @ApiProperty({
    example: {
      token: 'eyJhbGciOiJ...',
    },
  })
  data?: {
    token: string;
  };
}

//返回发送邮箱验证码对应的接口的类
export class EmailCode {
  @ApiProperty({ example: 200 })
  code?: number;
  @ApiProperty({
    example: {
      message: '邮箱发送成功',
      key: '23914452',
    },
  })
  data?: {
    message: string;
    key: string;
  };
}

//对于邮箱验证码的判断是否正确
export class responseValidateemailCode {
  @ApiProperty({ example: 200 })
  code?: number;
  @ApiProperty({
    example: {
      message: '邮箱发送成功',
    },
  })
  data?: {
    message: string;
  };
}

//登录接口
export class responseLogin {
  @ApiProperty({ example: 200 })
  code?: number;
  @ApiProperty({
    example: {
      id: '12',
      userName: 'admins',
      email: '2991519764@qq.com',
      avatar: 'uploads/1690959485037-2624999971.jpg',
      name: '云漫官方',
      gender: true,
      createAt: '2023-08-06T01:27:10.476Z',
      updateAt: '2023-08-06T01:27:10.476Z',
      token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiY...',
    },
  })
  data?: {
    message: string;
    userName: string;
    email: string;
    avatar: string;
    name: string;
    gender: boolean;
    createAt: Date;
    updateAt: Date;
    token: string;
  };
}

export class responseUser {
  @ApiProperty({ example: 200 })
  code?: number;
  @ApiProperty({
    example: {
      message: '删除用户成功',
    },
  })
  data?: {
    message: string;
  };
}
